ROS2 diagnostic
Table of Content
ROS2 diagnostic#
ROS diagnostics gives you the ability to monitor your system. There are two components in its architecture:
- updater
- aggregator
The updater publishes diagnostic status messages on the /diagnostics topic, and the aggregator listens to these statuses, aggregates them, and publishes the results on the /diagnostics_agg topic.
A system can have multiple updaters. They are meant to communicate with devices such as motors, sensors, computers, batteries, etc, in order to retrieve and publish relevant status data. The information being published on the /diagnostics topic is flat
The aggregator collects, categorizes, and groups the statuses from all the system components. You can take a look at what is being published on the /diagnostics and /diagnostics_agg topics with the rqt_runtime_monitor and rqt_robot_monitor tools
DiagnosticTask#
DiagnosticTask is an abstract base class for collecting diagnostic data.
A DiagnosticTask has a name, and a function that is called to create a DiagnosticStatusWrapper.
DiagnosticsTask subclass by
- CompositeDiagnosticTask
- FrequencyStatus
- GenericFunctionDiagnosticTask
- Heartbeat
- TimeStampStatus
diagnostic_aggregator#
Aggregator is a node that subscribes to /diagnostics, processes it and republishes aggregated data on /diagnostics_agg.
The aggregator creates a series of analyzers to handle incoming DiagnosticStatus

diagnostics viewers#
sudo apt install ros-humble-rqt-robot-monitor
sudo apt install ros-humble-rqt-runtime-monitor
